<template>
	<view class="newsdatils">
		<text class="title">{{newsArr.title}}</text>
		<view class="info">
			<text>发表时间:{{newsArr.addTime}}</text>
			<text>浏览次数:{{newsArr.clickNum}}</text>
		</view>
		<view class="imga">
			<image :src="newsArr.imgUrl" mode=""></image>
		</view>
		<view class="concant">
			{{newsArr.content}}
		</view>
		
	</view>
</template>

<script>
	export default{
		data(){
			return{
				id:-1,
				newsArr:''
			}
		},
		onLoad(options){
			this.id = options.id,
			this.getNews(options.id)
		},
		methods:{
			async getNews(){
				const res = await this.$myRequest({
					url:"/selectNewsById",
					data:{id:this.id}
				})
				this.newsArr = res.data
			}
		}
	}
</script>

<style lang="scss">
	page{
		background-color: white;
	}
	.newsdatils{
		font-size: 1rem;
		padding:0 20rpx;
		.title{
			text-align: center;
			width: 710rpx;
			display: block;
			margin:80rpx 0;
			font-weight: 700;
			font-size: 1.5rem;	
			line-height: 80rpx;
		}
		.info{
			display: flex;
			justify-content: space-between;
			flex-direction: column;
			margin-bottom: 40px;
			line-height: 60rpx;
			border-bottom: 1px solid #8c8c73;
			
		}
		.imga{
			text-align: center;
		}
	}
	
</style>